import java.util.Random;
import java.util.Scanner;

public class test5 {
    public static void main(String[] args) {
        Random r = new Random();
        int number = r.nextInt(100) + 1;
        //输入
        Scanner sc = new Scanner(System.in);

        //定义计数器

        while(true){

            System.out.println("请输入1到100之间的数字");
            int guess = sc.nextInt();
            if(guess > number){
                System.out.println("猜大了");
            }else if(guess < number){
                System.out.println("猜小了");
            }else{
                System.out.println("猜对了");
                break;
            }
        }
    }
}
